<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:t="http://myfaces.apache.org/tomahawk"
	template="/pages/template/main-layout.xhtml">

	<ui:define name="content">
		<t:saveState value="#{evokRoleBean.role}" />
		<t:saveState value="#{evokRoleBean.nodeType}" />

		<h:panelGrid cellpadding="5" width="100%" columns="2" columnClasses="width30,width70">

			<p:dataTable id="rolelist" var="ci" value="#{evokRoleBean.roleModel}" rowKey="#{ci.id}"
				selection="#{evokRoleBean.role}" selectionMode="single">
				<p:ajax event="rowSelect" listener="#{evokRoleBean.selectRole}"
						update=":mainform:nodetypelist, :mainform:nodetlist" />
				<f:facet name="header">
						Role List
					</f:facet>
				<p:column>
					<h:outputText value="#{ci.name}" />
				</p:column>
			</p:dataTable>

			<h:panelGrid columns="2" width="100%" columnClasses="width40,width60" >
				<p:dataTable id="nodetypelist" var="ci" value="#{evokRoleBean.paModel}" 
					selectionMode="single" widgetVar="wdgNodeTypeList">
					<p:ajax event="rowSelect" listener="#{evokRoleBean.selectNodeType}"
						update=":mainform:nodetlist" />

					<f:facet name="header">
						Node Type List
					</f:facet>
					<p:column>
						<h:outputText value="#{ci.name}" />
					</p:column>
				</p:dataTable>
				<h:panelGrid width="100%">
					<p:commandButton value="#{msgs.button_submit}" actionListener="#{evokRoleBean.submit}" 
						style="float:right;" update=":messages"/>
					<p:dataTable id="nodetlist" var="ci" value="#{evokRoleBean.nodeModel}"
						selection="#{evokRoleBean.selectedNodes}">
						<f:facet name="header">
						Node List
					</f:facet>
						<p:column selectionMode="multiple" style="width:18px" />
						<p:column headerText="NAME">
							<h:outputText value="#{ci.name}" />
						</p:column>

						<p:column headerText="DISPLAY">
							<h:outputText value="#{ci.labelValue}" />
						</p:column>
					</p:dataTable>
				</h:panelGrid>
			</h:panelGrid>
		</h:panelGrid>
	</ui:define>
</ui:composition>
